home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7428 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  44 lines

  1. Newsgroups: boeing.comp.unix,comp.lang.c,comp.lang.c++,comp.sources.wanted
  2. Path: mxsld2.pd.infn.it!LORETI
  3. From: loreti@mxsld2.pd.infn.it (Maurizio Loreti)
  4. Subject: Re: regular expression matching source code
  5. X-Nntp-Posting-Host: mxsld2.pd.infn.it
  6. Message-ID: <Dn7xuG.Ay1@news.cern.ch>
  7. Sender: news@news.cern.ch (USENET News System)
  8. Reply-To: loreti@mxsld2.pd.infn.it
  9. Organization: I.N.F.N. Padova - CDF/CMS VAXcluster
  10. References: <DMwHzn.LIF@bcstec.ca.boeing.com>
  11. Distribution: na
  12. Date: Fri, 23 Feb 1996 07:51:50 GMT
  13.  
  14. In article <DMwHzn.LIF@bcstec.ca.boeing.com>, waetzig@bcstec.ca.boeing.com (Todd Waetzig) writes:
  15. >I am looking for the 'C' or 'C++' source for a function to
  16. >perform a match of a string. This function would
  17. >use the syntax of regular expressions. This regular
  18. >expression matching would be similar to that used by
  19. >grep and sed.
  20. >
  21. >Ideally it would look something like
  22. >
  23. >if (match("^1([A-Z]*|[0-9]*)Z?",string_to_search) == 0)
  24. >    printf("match found ");
  25. >
  26. >this would match a string_to_search if it
  27. >    began with a digit 1
  28. >        followed by any number of occurences of uppercase letters
  29. >    or by any number of occurrences of digits
  30. >    followed by zero or one occurrence of the letter Z
  31. >
  32. >Thanks,
  33. >
  34. >-- 
  35. >Todd Waetzig                Programmer/Analyst     Boeing Computer Services
  36. >                                                   waetzig@bcstec.ca.boeing.com
  37.  
  38. Have a look at the 'regexp' package of the FSF; available from
  39. prep.ai.mit.edu:/pub/gnu - of finger fsf@prep.ai.mit.edu for a list of
  40. mirrors.  Good luck...
  41. --
  42. Maurizio Loreti                       http://mvxpd5.pd.infn.it/wwwcdf/mlo.html
  43. Un. of Padova, Dept. of Physics - Padova, Italy          loreti@padova.infn.it
  44.